package org.haq.bae.runtime.processor.common;

import org.haq.bae.runtime.processor.model.*;

/**
 * ProcessorFactory
 * A factory class for getting processor instance;
 * User: abiel
 * Date: 5/1/12
 * Time: 9:24 PM
 * Description:
 */
public class ProcessorFactory {
    private static ApplicationModelProcessor applicationModelProcessor;
    private static ViewModelProcessor viewModelProcessor;
    private static MenuModelProcessor menuModelProcessor;
    private static RelationModelProcessor relationModelProcessor;
    private static FieldModelProcessor fieldModelProcessor;
    private static DirectoryProcessor directoryProcessor;

    /**
     * get ApplicationModelProcessor
     *
     * @return applicationModelProcessor
     */
    public static ApplicationModelProcessor getApplicationModelProcessor() {
        if (applicationModelProcessor == null) applicationModelProcessor = new ApplicationModelProcessor();
        return applicationModelProcessor;
    }

    /**
     * get ViewModelProcessor
     *
     * @return viewModelProcessor
     */
    public static ViewModelProcessor getViewModelProcessor() {
        if (viewModelProcessor == null) viewModelProcessor = new ViewModelProcessor();
        return viewModelProcessor;
    }

    /**
     * get MenuModelProcessor
     *
     * @return menuModelProcessor
     */
    public static MenuModelProcessor getMenuModelProcessor() {
        if (menuModelProcessor == null) menuModelProcessor = new MenuModelProcessor();
        return menuModelProcessor;
    }

    /**
     * get RelationModelProcessor
     *
     * @return relationModelProcessor
     */
    public static RelationModelProcessor getRelationModelProcessor() {
        if (relationModelProcessor == null) relationModelProcessor = new RelationModelProcessor();
        return relationModelProcessor;
    }

    /**
     * get FieldModelProcessor
     *
     * @return fieldModelProcessor
     */
    public static FieldModelProcessor getFieldModelProcessor() {
        if (fieldModelProcessor == null) fieldModelProcessor = new FieldModelProcessor();
        return fieldModelProcessor;
    }


    /**
     * get DirectoryProcessor
     *
     * @return directoryProcessor
     */
    public static DirectoryProcessor getDirectoryProcessor() {
        if (directoryProcessor == null) directoryProcessor = new DirectoryProcessor();
        return directoryProcessor;
    }
}
